cmake_minimum_required(VERSION 3.5)
project(libuvc_camera)
# 查找
string(FIND "hello world" "world" index) # 查找字符串 world 在 hello world 中的位置
message("index: ${index}")
# 截取
string(SUBSTRING "hello world" 0 2 str) # 截取 he
message("str: ${str}")
# 替换
#[[
string(REPLACE old new result_var string)
]]
## 定义原始字符串
set(original_string "Hello, World!")

## 替换字符串
string(REPLACE "World" "Aliyun" result_string "${original_string}")
message(STATUS "Original string: ${original_string}")
message(STATUS "Result string: ${result_string}")

# 长度
string(LENGTH "hello world" len) # 计算字符串 hello world 的长度
message("len: ${len}")